<?php
/**
 * The following variables are available in this template:
 * - $this: the CrudCode object
 */
?>
<?php echo "<?php\n"; ?>
/* @var $this <?php echo $this->getControllerClass(); ?> */
/* @var $model <?php echo $this->getModelClass(); ?> */

<?php
$label=$this->pluralize($this->class2name($this->modelClass));
echo "\$this->breadcrumbs=array(
	'$label'=>array('index'),
	'Manage',
);\n";
?>
<?php echo " ?>\n"; ?>

<div class="pro_filter c_f">
	<div class="filter f_l">
	<?php echo "<?php \$form=\$this->beginWidget('CActiveForm', array(
		'action'=>Yii::app()->createUrl(\$this->route),
		'method'=>'get',
	)); ?>\n"; 
		 $count=0;
		 foreach($this->tableSchema->columns as $column){
				$field=$this->generateInputField($this->modelClass,$column);
				if(strpos($field,'password')!==false)
					continue;
				if(++$count==4) echo "\n\t<?php /* \n";
			    echo "\t\t<?php echo \$form->label(\$model,'{$column->name}'); ?>：\n";
			    echo "\t\t<?php echo ".$this->generateActiveField($this->modelClass,$column)."; ?>\n\n";
	
		}
		if($count>=4) echo "\t */ ?>\n\n";
		echo "\t\t<?php echo CHtml::submitButton(Yii::t('cmp','Search'),array('class'=>'mem_bgx mem_btn01')) ?>\n";
	
	 echo "\t\t<?php \$this->endWidget(); ?>\n"; ?>
	</div>
</div>

<table class="list_table list_table2" width="100%" cellpadding="0" cellspacing="0">
	<tr>
<?php
$count=0;
foreach($this->tableSchema->columns as $column)
{
	if(++$count==5)
		echo "\n\t<?php /*\n";
 	echo ($column->isPrimaryKey?"\t\t<th class = \"pl15\"":"\t\t<th width=\"20%\"")."><?php echo CHtml::encode(\$model->getAttributeLabel('{$column->name}')); ?></th>\n";
}
if($count>=5)
	echo "\t*/ ?>\n";
?>                      
		<th width="12%" class="">操作</th>                       
	</tr>
</table>

<?php echo "<?php"; ?> $this->widget('zii.widgets.CListView', array(
    'dataProvider'=>$model->search(),  
    'itemView'=>'_view',    
    'emptyText'=>'暂时没有数据',  
    'selectAll'=>array('ids[]','id[]'),
	'itemsTagName'=>'table',
	'itemsOptions'=>array('class'=>'list_table list_table2','width'=>'100%','cellpadding'=>0,'cellspacing'=>0),  
    'artLink'=>array(  
		//批量删除
		array(Yii::t('adm','Delete All'),$this->pre_module_url.'/'.Yii::app()->getController()->id.'/delete','确认批量删除选中项目！'),
	),
	'batchItem'=>array(    
        //添加    
        CHtml::linkbtn(Yii::t('glo','Create'),array('create')),       
    ), 
)); ?>
